﻿using System;
using System.Collections.Generic;
using System.Text;

using TTServer.Messages;

using libReadWrite;
using libCommonClass;

namespace TTServer.Messages
{
    public class NotifyMessage : TTMessage
    {
        private String _notice;

        public String Notice
        {
            get { return _notice; }
            set { _notice = value; }
        }

        public NotifyMessage()
        {

        }

        public NotifyMessage(String notice)
        {
            this._notice = notice;
        }

        public override void ReadMessage(BigEndianReader sr)
        {
            throw new NotImplementedException();
        }

        public override void WriteMessage(BigEndianWriter sw)
        {
            sw.Write((byte)MessageKind.MESSAGE_NOTICE);

            sw.Write(Global.NO_LENGTH_CODE);
            sw.WriteString(this._notice);
        }


        public override TTMessage Clone()
        {
            return new NotifyMessage();
        }

        public override int GetMessageID()
        {
            return MessageKind.MESSAGE_NOTICE;
        }

        public override string GetMessageName()
        {
            return "Notify";
        }
    }
}
